package com.zhuang.chapter12.work05;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Concordance {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);

		String string = sc.nextLine();
		String[] split = string.split(" ");
		StringBuilder sb = new StringBuilder();

		for (String s : split) {
			sb.append(s);
		}
		Map<Character, List<Integer>> map = new HashMap<>();
		for (int i = 0; i < sb.toString().length(); i++) {
			ArrayList<Integer> list = new ArrayList<>();
			char c = sb.charAt(i);
			if (map.containsKey(c)) {
				List<Integer> res = map.get(c);
				res.add(i);
				map.put(c, res);
			} else {
				list.add(i);
				map.put(c, list);
			}

		}
		System.out.println(map.toString());
	}
}
